//
//  GMEnclosureCell.m
//  Teecloud
//
//  Created by xhkj on 2018/11/24.
//  Copyright © 2018 小志. All rights reserved.
//

#import "GMEnclosureCell.h"
@interface GMEnclosureCell()
@property (weak, nonatomic) IBOutlet UIImageView *img;
@property (weak, nonatomic) IBOutlet UILabel *name;

@end
@implementation GMEnclosureCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setModel:(GMAttachListModel *)model{
    _model = model;
    self.name.text = model.Name;
    if ([model.FileType isEqualToNumber:@(3)]) {
        [self.img yy_setImageWithURL:[NSURL URLWithString:model.Url] placeholder:DefealtImg];
    }else if ([model.FileType isEqualToNumber:@(4)]){
        self.img.image =[UIImage imageNamed:@"doc-pdf"];
    }else if ([model.FileType isEqualToNumber:@(5)]){
        self.img.image =[UIImage imageNamed:@"doc-ppt"];
    }else if ([model.FileType isEqualToNumber:@(6)]){
        self.img.image =[UIImage imageNamed:@"doc-word"];
    }else if ([model.FileType isEqualToNumber:@(7)]){
       self.img.image =[UIImage imageNamed:@"doc-excel"];
    }else if ([model.FileType isEqualToNumber:@(8)]){
        self.img.image =[UIImage imageNamed:@"doc-rar"];
    }else if ([model.FileType isEqualToNumber:@(9)]){
        self.img.image =[UIImage imageNamed:@"doc-zip"];
    }else{
        self.img.image =[UIImage imageNamed:@"doc-other"];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
